package com.xy.modulemain.view

import android.content.Context
import android.view.View
import com.blankj.utilcode.util.ToastUtils
import com.xy.modulemain.BR
import com.xy.modulemain.R
import com.xy.modulemain.bean.Item
import com.xy.modulemain.databinding.ItemViewBinding

/**
 * @ClassName ImageItemView
 * @Author xy
 * @Date 2021/8/23 10:07
 * @Description 描述
 */
class ImageItemView : BaseCustomView<ItemViewBinding, Item> {
    constructor(context: Context?) : super(context)

    override fun getLayoutId(): Int {
        return R.layout.item_view
    }

    //绑定数据
    override fun setDataToView(data: Item) {
        dataBinding.setVariable(BR.ItemImg, data)
        dataBinding.img.setOnClickListener {
            ToastUtils.showShort("点击了图片")
        }
    }

    override fun onRootViewClick(view: View) {
        ToastUtils.showShort("点击了有图片的Item")
    }

}